<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<html>
	<head>
		<title>释放单管理-金融风险管理系统</title>
		<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
		<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
		function jumpPage(page) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/update/index.do?currentPage=" + page;
			searchForm.submit();
		}
		function checkdate(start,end){   
			 //得到日期值并转化成日期格式，replace(/\-/g, "\/")是根据验证表达式把日期转化成长日期格式，这样
			 //再进行判断就好判断了
				var sDate = new Date(start.value.replace(/\-/g, "\/"));
			    var eDate = new Date(end.value.replace(/\-/g, "\/"));
			    if(sDate > eDate){
			    	alert("结束日期不能小于开始日期");
			    	end.value="";
			    	end.focus();
			    	return false;
			    }
			    return true;
			 }
		function update(id){
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/toTeUpdate.do?currentPage=${currentPage}&cer.id="+id;
			searchForm.submit();
		}
		
		function deleteData(id) {
			if(confirm("确认要删除吗?")) {
				var searchForm = document.searchForm;
				searchForm.action = "<s:property value='contextPath'/>/cm/update/destory.do?currentPage=${currentPage}&id="+id;
				searchForm.submit();
			}	  
		}
		</script>
	</head>
	<body>
	<div class="navigation">
	    <span>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="javascript:window.location.reload();">刷新</a>
	    </span>合格证管理&gt;&gt;修改记录
    </div>
    
    <div class="xt_main_right_center">
      <form name="searchForm" id="searchForm" method="post" action="index.do">
	      <table width="100%" border="0" cellpadding="0" cellspacing="0"  style="border-color:#CCCCCC;">
	        <tr>
	        	<td class="left-td-width-bg">&nbsp;金融机构:&nbsp; </td>
	        	<td>
	           		<select  class="input" name="search.financial.name" id="select2">
		        <option  value="" selected="selected">****请选择****</option>
		         <s:iterator value="financials" status="i" id="b">
		          <option <s:if test='search.financial.name.equals(#b.name)'>selected="selected"</s:if>  value="${b.name }">${b.name }</option>
		          </s:iterator>
		      </select>
	            </td>
	            <td  class="left-td-width-bg">&nbsp;车架号:&nbsp; </td>
	            <td>
	            	<input type="text" name='search.chassis'  value="<s:property value="search.chassis"/>" class="input"/>
	            </td>
	            <td class="left-td-width-bg">&nbsp;店名:&nbsp; </td>
	            <td>
	            	<input type="text" name='search.shop.shopName' value="<s:property value="search.shop.shopName"/>" class="input"/>
	            </td>
	        </tr>
	        <tr>
	        	<td class="left-td-width-bg">&nbsp;合格证号:&nbsp; </td>
	        	<td>
	           		<input type="text" name='search.certificationNum' value="<s:property value="search.certificationNum"/>"  class="input"/>
	            </td>
	        	<td class="left-td-width-bg">&nbsp;渠道:&nbsp; </td>
	        	<td>
	        	<select  class="input" name="search.brand.name" id="select2">
		       		<option  value="">****请选择****</option>
			         <s:iterator value="brandList" status="i" id="b">
			          <option <s:if test='search.brand.name.equals(#b.name)'>selected="selected"</s:if>  value="${b.name }">${b.name }</option>
			          </s:iterator>
		      </select>
	            </td>
	            <td class="left-td-width-bg">出门日:&nbsp;</td>
	            <td>
	            	<input name="search.goingOutDateBegin" id="goingOutDateBegin" class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.goingOutDateBegin" format="yyyy-MM-dd"/>" onblur="checkdate(this,document.getElementById('goingOutDateEnd'))"/>
	            	至 <input name="search.goingOutDateEnd" id="goingOutDateEnd"  class="Wdate" type="text" style="width: 100px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" value="<s:date name="search.goingOutDateEnd" format="yyyy-MM-dd"/>" onblur="checkdate(document.getElementById('goingOutDateBegin'),this)"/>
	            </td>
	        </tr>
	        <tr>
	        	<td class="left-td-width-bg">状态：</td>
	        	<td>
	        		<select name="status" class="input">
	        			<option value="-1" <s:if test="status==-1">selected</s:if>>***请选择***</option>
	        			<option value="1" <s:if test="status==1">selected</s:if>>待审核</option>
	        			<option value="2" <s:if test="status==2">selected</s:if>>已退回</option>
	        			<option value="3" <s:if test="status==3">selected</s:if>>已完成</option>
	        		</select>
	        	</td>
	        	<td colspan="4"> </td>
	        </tr>
	        <tr style="background:url(${contextPath}/images/xt_main_right_dhbj.jpg) repeat-x;">
			    <td height="28" colspan="6" align="right" style="border-bottom:none;">
			    	<input type="reset" value="" class="btn_clear_form" onclick="clearForm(this.form);return false;"/>
			    	<input name="" type="submit" name="submit" value=""  class="btn_query"/>
			    </td>
		    </tr>
	      </table>
      </form>
      </div>
      <br/>
      
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
		  <tr>
		    <td height="25" align="left"><font color="#0066CC"><strong>查询结果：</strong></font></td>
		  </tr>
		</table>
      
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
	  <tr> 
	    <td width="3%" class="top-td-width-bg">序号</td>
	    <td width="8%" class="top-td-width-bg">渠道</td>
	    <td width="6%" class="top-td-width-bg">店名</td>
	    <td width="6%" class="top-td-width-bg">车型</td>
	    <td width="8%" class="top-td-width-bg">合格证号</td>
	    <td width="8%" class="top-td-width-bg">车架号</td>
	    <td width="6%" class="top-td-width-bg">供货价</td>
	    <td width="6%" class="top-td-width-bg">订单号</td>
	    <td width="6%" class="top-td-width-bg">汇票号</td>
	    <td width="6%" class="top-td-width-bg">汇票开始日</td>
	    <td width="6%" class="top-td-width-bg">汇票结束日</td>
	    <td width="6%" class="top-td-width-bg">出门日</td>
	    <td width="6%" class="top-td-width-bg">预定到店日</td>
	    <td width="4%" class="top-td-width-bg">状态</td>
	    <td width="6%" class="top-td-width-bg">操作</td>
	  </tr>
	 <s:iterator value="page.result" status="st" >
		<tr height="26" align="center" bgcolor="#FFFFFF">
			<td align="center"><s:property value="#st.index+1"/></td>
		    <td align="center"><s:property value="brand.name"/></td>
		    <td align="center"><s:property value="shop.shopName"/></td>
		    <td align="center"><s:property value="motorcycleType"/></td>
		    <td align="center"><s:property value="certificationNum"/></td>
		    <td align="center"><s:property value="chassis"/></td>
		    <td align="center"><s:property value="formatAmount(supplyPrice)"/> </td>
		    <td align="center"><s:property value="orderNumber"/></td>
		    <td align="center"><s:property value="draft"/></td>
		    <td align="center"><s:date name="draftBeginDate" format="yyyy-MM-dd"/></td>
		    <td align="center"><s:date name="draftEndDate" format="yyyy-MM-dd"/></td>
		    <td align="center"><s:date name="goingOutDate" format="yyyy-MM-dd"/></td>
		    <td align="center"><s:date name="scheduledDate" format="yyyy-MM-dd"/></td>
		    <td align="center"><s:property value="status.name" /></td>
			<td align="center">
			<s:if test="status.index==1">
				<jysz:permission code="CM_UPDATE_RECORD_AUDIT">
					<a href="toExamine.do?id=<s:property value="certification.id"/>">审核</a>
				</jysz:permission>
			</s:if>
			<s:elseif test="status.index==2">
				<jysz:permission code="CM_CER_UPDATE">
				<s:if test="@com.jysz.certificate.persistence.enums.CertificationType@INSTOCK.equals(certification.state)">
					<a href="javascript:update(<s:property value='certification.id'/>)" title="修改"><img src="${contextPath}/images/update.png" alt="修改" width="19" height="19" border="0" /></a> 
				</s:if>
				</jysz:permission>
			</s:elseif>
			
		<s:if test="@com.jysz.certificate.persistence.enums.CertificateStatus@SUBMITED.equals(status) || @com.jysz.certificate.persistence.enums.CertificateStatus@REFUSED.equals(status)">
			 <jysz:permission code="CM_UPDATE_RECORD_DELETE">
	   		  <a href="javascript:deleteData(<s:property value="id"/>)" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
	   		 </jysz:permission>
		</s:if>
			<a href="toDetail.do?id=<s:property value="id"/>" title="详情"><img src="${contextPath}/images/chakan.gif" alt="详情" width="16" height="18" border="0" /></a>
		  </td>
		</tr>
	</s:iterator>
	<tr bgcolor="#F9FCEF"> 
	 <td height="36" colspan="17" align="center">
			<%@ include file="/WEB-INF/view/common/pagination.jsp"%>
	 </td>
	</tr>
	</table>

		<br/><br/><br/><br/><br/>
		<div><jsp:include page="/include/footer.inc"></jsp:include></div>
	</body>
</html>